<?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        $view = $this->view;
        
        $category = new Business_Category();
        $categories = $category->getAll();
        $view->categories = $categories;
        
        $product = new Business_Product();
        $view->homepageProductList = $product->getHomePageProduct();
        
        $post = new Business_Post();
        //获取简短联系方式
        $shortContact = $post->getByCateId(1);
        if (isset($shortContact[0]) && isset($shortContact[0]['content'])) {
        	$view->shortContact = $shortContact[0]['content'];
        } else {
        	$view->shortContact = '';
        }
        
        //获取脚注信息
        $footInfo = $post->getByCateId(3);
        if (isset($footInfo[0]) && isset($footInfo[0]['content'])) {
        	$view->footInfo = $footInfo[0]['content'];
        } else {
        	$view->footInfo = '';
        }
        
        //获取首页企业简介
        $shortIntro = $post->getByCateId(4);
        if (isset($shortIntro[0]) && isset($shortIntro[0]['content'])) {
        	$view->shortIntro = $shortIntro[0]['content'];
        } else {
        	$view->shortIntro = '';
        }
    }
    
    public function testAction()
    {
        $view = $this->view;
        $view->test = "1234124tew";
    }


}

